<div class="animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="row search-area">
    <div class="col-xs-6 col-md-6">
      <div class="btn-group" role="group">
        <!-- <a class="btn btn-default" ui-sref=".add" title="后台下单"><i class="fa fa-plus-circle"></i><span class="hidden-xs">后台下单</span></a> -->
        <!-- <a class="btn btn-default" ng-click="remove()" title="删除"><i class="fa fa-times-circle"></i><span class="hidden-xs">删除</span></a> -->
      </div>
    </div>

    <div class="col-xs-6 col-md-6">
      <form class="form-inline pull-right">
        <div class="input-group" >
          <input class="form-control" type="text" ng-model="orders.orderNo" placeholder="订单号">
          <span class="input-group-btn">
            <button class="btn btn-primary" type="button" ng-click="search()"><i class="fa fa-search"></i><span class="hidden-xs">搜索</span></button>
          </span>
        </div>
        <a class="btn btn-default" data-toggle="modal" data-backdrop="static" data-target="#advancedSearch"><i class="fa fa-filter"></i><span class="hidden-xs">高级搜索</span></a>
        <a class="btn btn-default" ng-click="exportExcel()" title="导出excel"><i class="fa fa-download"></i><span class="hidden-xs">导出excel</span></a>
      </form>
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12 col-md-12">
      <div ui-grid="gridOptions" ui-grid-selection ui-grid-pagination ui-grid-resize-columns ui-grid-move-columns class="grid"></div>
    </div>
  </div>
</div>

<div class="modal" id="advancedSearch" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
       <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title">高级搜索</h4>
       </div>
       <div class="modal-body">
          <div class="row">
            <div class="col-xs-12 col-md-12">
              <form class="form-horizontal searchForm" role="form" name="orderForm" >
                <div class="row">
                  <div class="col-xs-6 col-md-6">
                    <div class="form-group">
                      <label class="control-label hidden-xs hidden-sm col-md-3">订单号：</label>
                      <div class="col-xs-12 col-md-9">
                        <input type="text" class="form-control" name="orderNo" placeholder="订单号" ng-model="orders.orderNo">
                      </div>
                    </div>
                  </div>
                  <div class="col-xs-6 col-md-6">
                    <div class="form-group">
                      <label class="control-label hidden-xs hidden-sm col-md-3">创建时间：</label>
                      <div class="col-xs-12 col-md-9">
                        <input type="text" class="form-control fl w120" id="beginCreateTime" name="beginCreateTime" placeholder="创建起始" idate ng-model="orders.beginCreateTime">
                        <em class="fl spitter">--</em>
                        <input type="text" class="form-control fl w120" id="endCreateTime" name="endCreateTime" placeholder="创建截止" idate ng-model="orders.endCreateTime">
                      </div>
                    </div>
                  </div>
                </div>
                <div class="row">
                  <div class="col-xs-6 col-md-6">
                    <div class="form-group">
                      <label class="control-label hidden-xs hidden-sm col-md-3">订单状态：</label>
                      <div class="col-xs-12 col-md-9">
                        <select class="form-control" name="status" ng-model="orders.status" ng-change="changeOrderStatus()">
                          <option ng-repeat="item in orders.statusList" value="{{item.value}}">{{item.text}}</option>
                        </select>
                      </div>
                    </div>
                  </div>
                  <div class="col-xs-6 col-md-6">
                    <div class="form-group">
                      <label class="control-label hidden-xs hidden-sm col-md-3">订单类型：</label>
                      <div class="col-xs-12 col-md-9">
                        <select class="form-control" name="type" ng-model="orders.type" ng-change="changeOrderType()">
                          <option ng-repeat="item in orders.typeList" value="{{item.value}}">{{item.text}}</option>
                        </select>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="row">
                  <div class="col-xs-6 col-md-6">
                    <div class="form-group">
                      <label class="control-label hidden-xs hidden-sm col-md-3">用户ID：</label>
                      <div class="col-xs-12 col-md-9">
                        <input type="text" class="form-control" name="userId" placeholder="用户ID" ng-model="orders.userId">
                      </div>
                    </div>
                  </div>
                  <div class="col-xs-6 col-md-6">
                    <div class="form-group">
                      <label class="control-label hidden-xs hidden-sm col-md-3">收件人：</label>
                      <div class="col-xs-12 col-md-9">
                        <input type="text" class="form-control" name="receiver" placeholder="收件人" ng-model="orders.receiver">
                      </div>
                    </div>
                  </div>
                </div>                
              </form>
            </div>
          </div>
       </div>
       <div class="modal-footer">
          <button type="button" class="btn btn-primary" ng-click="search()" data-dismiss="modal">搜索</button>
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
       </div>
    </div>
  </div>
  <iframe ng-src="{{exportExcelUrl}}" style="width:0;height:0;" seamless frameborder="0"></iframe>
</div>

<script type="text/javascript">
$('#advancedSearch').on('shown.bs.modal', function () {
  $(".modal-backdrop").css({"position": "static"});
}).on('hidden.bs.modal', function(){
  $(".modal-backdrop").css({"position" : "fixed"});
});
</script>